An electric motor converts electricity into mechanical power in the form of a rotating shaft known as a rotor. The electrical currents flowing through field windings in a stator of the electric motor may cause the rotor to rotate at a certain speed or angular velocity. A controller device may implement a method known as field-oriented control (FOC) or vector control to determine the amplitude of the electrical currents that should flow through each field winding of the stator. A controller device using FOC may measure the electrical currents through the field windings and determine pulse-width modulated (PWM) control signals for power-conversion circuitry that drives the electric motor. The controller device may determine the time durations for each of the switches in the power-conversion circuitry based on the desired voltages to be applied to each field winding.